package cn.tedu.batch.sink

import org.apache.flink.api.scala.ExecutionEnvironment

/**
 * @author Amos
 * @date 2022/5/22
 */

object BatchSinkCollection {
  def main(args: Array[String]): Unit = {
    val env = ExecutionEnvironment.getExecutionEnvironment
    import org.apache.flink.api.scala._
    val stu: DataSet[(Int, String, Double)] = env.fromElements(
      (19, "zhangsan", 178.8),
      (17, "lisi", 168.8),
      (18, "wangwu", 184.8),
      (21, "zhaoliu", 164.8)
    )

//    // 1.标准输出
//    stu.print()

//    // 2. 标准error输出
//    stu.printToErr()

    // 3. 收集数据到本地collection
    print(stu.collect())
  }

}
